import type { RouteRecordRaw } from 'vue-router'

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/Error/404.vue'),
    meta: {
      hidden: true,
    },
  },

  {
    path: '/',
    component: () => import('@/views/WHome/index.vue'),
  },
  {
    path: '/goodslist',
    name: 'WGoodsList',
    component: () => import('../views/GoodsList/index.vue'),
  },
  {
    path: '/saleRank',
    name: 'WSaleRank',
    component: () => import('@/views/WSaleRank/index.vue'),
  },
  {
    path: '/cart',
    component: () => import('@/views/WaddShopCart/index.vue'),
    name: 'WaddShopCart'
  },
  {
    path: '/detail',
    name: 'WDetail',
    component: () => import('../views/WDetail/index.vue'),
  },
  {
    path: '/trade',
    component: () => import('@/views/WTrade/index.vue'),
    name: 'WTrade'
  },
  {
    path: '/pay',
    component: () => import('@/views/WPay/index.vue'),
    name: 'WPay'
  },
  {
    path: '/paysuccess',
    component: () => import('@/views/WPaySuccess/index.vue'),
    name: 'WPaySuccess'
  },
  {
    path: '/center',
    component: () => import('@/views/WCenter/index.vue'),
    name: 'WCenter'
  },
  {
    path: '/search',
    name: 'WSearch',
    component: () => import('../views/WSearch/index.vue')
  }
]

/* 匹配任意的路由 必须最后注册 */
export const anyRoute: RouteRecordRaw = {
  path: '/:pathMatch(.*)',
  name: 'Any',
  redirect: '/404',
}
